import 'package:flutter/material.dart';
import 'package:xws/utils/app_util.dart';

/// 返回按钮
class BackIcon extends StatelessWidget {
  const BackIcon({Key? key, this.color, this.onTap}) : super(key: key);

  final Color? color;

  final Function()? onTap;

  @override
  Widget build(BuildContext context) {
    return IconButton(
      onPressed: onTap ?? () => pop(context),
      icon: Icon(
        Icons.arrow_back_ios_new_rounded,
        color: color ?? Theme.of(context).iconTheme.color,
      ),
    );
  }
}
